<?php
namespace admin\module\set;
use inc\BaseAjax\BaseAjax;
require('../../../global.php');



class ajax extends BaseAjax
{
    
    
   

    protected function edit()
    {
        global $db;
        $set = array(
            
            'test_result_content' => $_POST['test_result_content'],
            'reserve_content' => $_POST['reserve_content'],
            'edittime' => date('Y-m-d H:i:s'),
        );
        
        if($_POST['id'] != ''){
        
            $db->update('tb_setting', $set, array(
                'tbid' => $_POST['id']
            ));
            $cb['status'] = 'y';
        }else{
        
            $set['createtime'] = date('Y-m-d H:i:s');
            $rs = $db->insert('tb_setting', $set);
            if($rs){
                $cb['status'] = 'y';
            }else{
                $cb['status'] = 'n';
            }
        }
        echo json_encode($cb);
    }
    
    /**
     * 更新预约时间
     * 
     * @author : bapijun
     */
    protected function editFollow()
    {
        global $db;
        $set = array(
            
            'confirm_time' => $_POST['confirm_time'],
            'situation' => $_POST['situation'],
            'is_test' => $_POST['situation'],
            'reserve_result' => $_POST['reserve_result'],
            'evaluation' => $_POST['evaluation'],
            'edittime' => date('Y-m-d H:i:s'),
        );
        
        $db->update('tb_expert_reserve', $set, array(
                'tbid' => $_POST['id']
            ));
            $cb['status'] = 'y';
        echo json_encode($cb);
    }
    

}

$ajax = new ajax();
$ajax->dealWithAjax();
